{#
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends 'base-protocol.html' %}

{% block page_title %}Firefox Newsletter{% endblock page_title %}

{% block page_css %}
  {{ css_bundle('newsletter-firefox-confirm') }}
{% endblock %}

{% if LANG == 'de' %}
  {% set headline_text = 'Bleib mit Mozilla über unseren Firefox News-Newsletter auf dem Laufenden' %}
  {% set tagline_text = 'Wenn du abonnierst, erhältst du aktuelle Produkt-Updates, Expert:innentipps und wichtige News von Mozilla.' %}
  {% set cta_text = 'Abonnieren' %}
  {% set thanks_text = 'Danke, dass Sie den Newsletter abonniert haben! Ihr Newsletter-Abonnement wurde bestätigt.' %}
{% elif LANG == 'fr' %}
  {% set headline_text = 'Restez en lien avec Mozilla grâce à la newsletter Firefox News' %}
  {% set tagline_text = 'En vous abonnant, vous recevrez les dernières mises à jour de nos produits, des conseils d’experts et des actualités importantes concernant Mozilla.' %}
  {% set cta_text = 'Je m’abonne' %}
  {% set thanks_text = 'Merci pour votre inscription ! Votre abonnement à la newsletter Firefox News est maintenant confirmé.' %}
{% else %}
  {% set headline_text = 'Stay connected with Mozilla, courtesy of our Firefox News newsletter' %}
  {% set tagline_text = 'By subscribing, you’ll receive the latest product updates, expert tips, and important news from Mozilla—ensuring you stay safe and informed online.' %}
  {% set cta_text = 'Subscribe' %}
  {% set thanks_text = 'Thanks for Subscribing! Your newsletter subscription has been confirmed.' %}
{% endif %}

{% block content %}
<main class="mzp-l-content mzp-t-content-lg mzp-u-centered">
  <header>
    <h1 class="page-title">{{ headline_text }}</h1>
  </header>

  <form id="confirmation-form" class="c-confirm-form" method="post" action="{{ action }}" data-recovery-url="{{ url('newsletter.recovery') }}">
    <input type="hidden" name="newsletters" value="{{ newsletters }}">
    <input type="hidden" name="source_url" value="{{ source_url|absolute_url }}">
    <input type="hidden" name="lang" value="{{ newsletter_lang }}">
    <p class="c-confirm-form-tagline">{{ tagline_text }}</p>
    <div class="c-confirm-form-errors mzp-c-form-errors hidden" id="confirm-form-errors">
      <p class="c-confirm-error-msg error-invalid-token hidden">
        {{ ftl('newsletters-this-email-address-is-not', url=url('newsletter.firefox')) }}
      </p>
      <p class="c-confirm-error-msg error-try-again-later hidden">
        {{ ftl('newsletters-we-are-sorry-but-there') }}
      </p>
      <p class="c-confirm-error-msg error-update-browser hidden">
        {{ ftl('newsletters-update-your-browser') }}
      </p>
    </div>
    <button type="submit" class="c-confirm-form-submit mzp-c-button">
      {{ cta_text }}
    </button>
    <p class="c-confirm-small">
      <small>{{ ftl('newsletter-form-we-will-only-send-firefox-v2') }}</small>
    </p>
  </form>
  <div class="c-confirm-form-thanks hidden">
    <p>{{ thanks_text }}</p>
  </div>
</main>
{% endblock %}

{% block js %}
  {{ js_bundle('newsletter-firefox-confirm') }}
{% endblock %}
